<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    
    <style>

        .container{
            height: 300px;
            width: 300px;
            border: 2px solid orange;

            margin: 100px;
        }

        .box{
            height: 100px;
            width: 100px;
            background-color: green;

            /* 相对于父级元素进行定位，无论父级元素是否有定位 */
            position: relative;
            left: 100px;
            top: 100px;
        }
    </style>

</head>
<body>
    <div class="container">
        <div class="box"></div>
    </div>
</body>
</html>